package cn.hutool.osc.miniodto;


import io.minio.messages.LegalHold;
import io.minio.messages.RetentionMode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.ZonedDateTime;
import java.util.Map;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class MinioObjectStat {
    private String object;
    private String bucket;
    private String etag;
    private long size;
    private ZonedDateTime lastModified;
    private RetentionMode retentionMode;
    private ZonedDateTime retentionRetainUntilDate;
    private LegalHold legalHold;
    private boolean deleteMarker;
    private Map<String, String> userMetadata;

    private Owner owner;

    public MinioObjectStat(String objectName, String bucketName, String etag, long size, ZonedDateTime zonedDateTime, RetentionMode retentionMode, ZonedDateTime zonedDateTime1, LegalHold legalHold, boolean b, Map<String, String> stringStringMap) {
        this.object = objectName;
        this.bucket = bucketName;
        this.etag = etag;
        this.size = size;
        this.lastModified = zonedDateTime;
        this.retentionMode = retentionMode;
        this.retentionRetainUntilDate = zonedDateTime1;
        this.legalHold = legalHold;
        this.deleteMarker = b;
        this.userMetadata = stringStringMap;
    }


    public MinioObjectStat(String bucketName, String objectName, String etag, long size, Map<String, String> stringStringMap, ZonedDateTime zonedDateTime, Owner owner) {
        this.bucket = bucketName;
        this.object = objectName;
        this.etag = etag;
        this.size = size;
        this.userMetadata = stringStringMap;
        this.lastModified = zonedDateTime;
        this.owner = owner;
    }


    //创建一个内部类Owner
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Owner {
        private String id;
        private String displayName;

    }

}
